const a = function (echarts, d, { xe: { commafy, get, pluck } }) {
  const items = get(d, "data.items", []);
  if (!items.length) return {};
  console.log("功能科目chart data: ", items);
  items.sort((a, b) => b.ys - a.ys);
  items.forEach((i) => {
    i.ys = ((i.ys || 0) / 10000).toFixed(2);
    i.zc = ((i.zc || 0) / 10000).toFixed(2);
    i.zxl = ((i.zxl || 0) * 100).toFixed(1);
    i.label = i.name + "-" + i.code;
  });
  return {
    tooltip: {
      trigger: "axis",
      axisPointer: { type: "shadow", label: { backgroundColor: "#283b56" } },
    },
    legend: {},
    grid: { containLabel: true, top: 80, left: 20, right: 80, bottom: 20 },
    xAxis: {
      type: "category",
      boundaryGap: true,
      data: pluck(items, "label"),
      axisLabel: {
        rotate: 20,
      },
    },
    yAxis: [
      { type: "value", name: "单位: 万元" },
      { type: "value", name: "单位: %" },
    ],
    series: [
      {
        name: "预算",
        type: "bar",
        stack: "ys",
        data: pluck(items, "ys"),
        label: {
          show: true,
          position: "top",
        },
      },
      {
        name: "支出",
        type: "bar",
        stack: "zc",
        data: pluck(items, "zc"),
        label: {
          show: true,
          position: "top",
        },
      },
      {
        name: "执行率",
        type: "line",
        data: pluck(items, "zxl"),
        yAxisIndex: 1,
      },
    ],
  };
};
